package com.chainyoung.trademarket.mvp.model;

import com.chainyoung.common.appcommon.entity.CommonList;
import com.chainyoung.common.integration.IRepositoryManager;
import com.chainyoung.common.mvp.BaseModel;
import com.chainyoung.common.utils.RxUtils;
import com.chainyoung.trademarket.api.MainService;
import com.chainyoung.trademarket.entity.Ad;
import com.chainyoung.trademarket.mvp.contract.AdDetailContract;
import com.chainyoung.trademarket.mvp.contract.InformationContact;

import java.util.TreeMap;

import javax.inject.Inject;

import io.reactivex.Flowable;

public class InformationModel extends BaseModel implements InformationContact.Model {

    @Inject
    public InformationModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }




    @Override
    public Flowable<CommonList<Ad>> getInformationList(TreeMap<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(MainService.class)
                .getInformationList(map)
                //.compose(RxUtils.<BaseResponse<UserInfo>>rxSchedulerHelper())
                .compose(RxUtils.<CommonList<Ad>>handleResult());
    }
}


